function callprint(linkstyle,title) {
	if(navigator.appName)
	try{
		jsPrintSetup.setPaperSizeUnit(jsPrintSetup.kPaperSizeMillimeters);
	}catch(e){
		$('#basic-modal-content').modal();
		return false;
	}
	var display_setting="toolbar=no,location=no,directories=no,menubar=no,";
	display_setting+="scrollbars=yes,width=760, height=800";
	
	var content_innerhtml = $('div.Section1').html();
	var document_print=window.open("","",display_setting);
	document_print.document.open();
	document_print.document.write('<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"/><link rel="stylesheet" type = "text/css" href = "'+linkstyle+'efy-style/print.css" /><script language="javascript" src="'+linkstyle+'efy-js/print.js" type="text/javascript"></script><script language="javascript" src="'+linkstyle+'efy-js/jquery-1.6.4.min.js" type="text/javascript"></script><title>'+title+'</title></head>');
	document_print.document.write('<body><div class="dontprint sprint" ><input onclick = "setPapersize(9)" type = "radio" value = "A4" name = "op" id = "a4"/><label class = "normal_label" for = "a4">In A4</label><input onclick = "setPapersize(11)" type = "radio" value = "A5" name = "op" id = "a5" checked/><label class = "normal_label" for = "a5">In A5</label><input class = "link-button" type = "button" name = "aprint" value = "In" onclick = "print();" /></div>');
	document_print.document.write(content_innerhtml);
	document_print.document.write('<script>$("document").ready(function (){$("div.divl1:eq(0)").css("padding-top","5px");});</script></body></html>');
	document_print.document.close();
}
function print() {
	jsPrintSetup.setPaperSizeUnit(jsPrintSetup.kPaperSizeMillimeters);
	jsPrintSetup.setOption('paperHeight',297);
	jsPrintSetup.setOption('paperWidth',210);
	jsPrintSetup.setOption('numCopies',1);
	jsPrintSetup.setOption('orientation',jsPrintSetup.kPortraitOrientation);
	jsPrintSetup.setOption('marginTop',0);
	jsPrintSetup.setOption('marginBottom',0);
	jsPrintSetup.setOption('marginLeft',0);
	jsPrintSetup.setOption('marginRight',0);
	jsPrintSetup.setOption('headerStrCenter','');
	jsPrintSetup.setOption('headerStrLeft','');
	jsPrintSetup.setOption('headerStrRight','');
	jsPrintSetup.setOption('footerStrCenter','');
	jsPrintSetup.setOption('footerStrLeft','');
	jsPrintSetup.setOption('footerStrRight','');
	jsPrintSetup.setOption('paperData',9);
	jsPrintSetup.setOption('printBGColors',1);
	jsPrintSetup.setOption('printBGImages',1);
	jsPrintSetup.setOption('shrinkToFit',1);
	
	var listPrinter = jsPrintSetup.getPrintersList();
	var arrPrinter = listPrinter.split(',');
	// sets printer 
    jsPrintSetup.setPrinter(arrPrinter[0]);
    jsPrintSetup.clearSilentPrint();
    jsPrintSetup.setSilentPrint(0);
    jsPrintSetup.print();
    window.close();
}
function callprintA4(linkstyle,title) {
	if(navigator.appName)
	try{
		jsPrintSetup.setPaperSizeUnit(jsPrintSetup.kPaperSizeMillimeters);
	}catch(e){
		$('#basic-modal-content').modal();
		return false;
	}
	var display_setting="toolbar=no,location=no,directories=no,menubar=no,";
	display_setting+="scrollbars=yes,width=1000, height=800";
	var content_innerhtml = $('div.Section1').html();
	var document_print=window.open("","",display_setting);
	document_print.document.open();
	document_print.document.write('<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"/><link rel="stylesheet" type = "text/css" href = "'+linkstyle+'efy-style/print.css" /><script language="javascript" src="'+linkstyle+'efy-js/print.js" type="text/javascript"></script><title>'+title+'</title></head>');
	document_print.document.write('<body onLoad="self.printA4();">');
	document_print.document.write(content_innerhtml);
	document_print.document.write('<script type = "text/javascript">alert("hello")</script>');
	document_print.document.write('</body></html>');
	document_print.document.close();
}
function printA4() {
	jsPrintSetup.setPaperSizeUnit(jsPrintSetup.kPaperSizeMillimeters);
	jsPrintSetup.setOption('paperHeight',297);
	jsPrintSetup.setOption('paperWidth',210);
	jsPrintSetup.setOption('numCopies',1);
	jsPrintSetup.setOption('orientation',0);
	jsPrintSetup.setOption('printBGImages',1);
	jsPrintSetup.setOption('printBGColors',1);
	jsPrintSetup.setOption('marginTop',5);
	jsPrintSetup.setOption('marginBottom',5);
	jsPrintSetup.setOption('marginLeft',5);
	jsPrintSetup.setOption('marginRight',5);
	jsPrintSetup.setOption('headerStrCenter','');
	jsPrintSetup.setOption('headerStrLeft','');
	jsPrintSetup.setOption('headerStrRight','');
	jsPrintSetup.setOption('footerStrCenter','');
	jsPrintSetup.setOption('footerStrLeft','');
	jsPrintSetup.setOption('footerStrRight','');
	jsPrintSetup.setOption('paperData',9);
	var listPrinter = jsPrintSetup.getPrintersList();
	var arrPrinter = listPrinter.split(',');
	// sets printer 
    jsPrintSetup.setPrinter(arrPrinter[0]);
    jsPrintSetup.setSilentPrint(0);
    jsPrintSetup.print();
    window.close();
}
function setPapersize(ps){
	var obj = document.getElementsByName('lienprint');	
	var iw = '';
	if(ps == 9){
		$('hr.hrdeli').hide();
		$('<div class = "brpg"></div>').insertAfter('div.divl1');
		$('div.divl1').css('height','auto');
		$('div.divl2').css('height','auto');
	}
	else if(ps == 11){
		$('hr.hrdeli').show();
		$('div.divl1 + div.brpg').remove();
		$('div.divl1').css('height','527px');
		$('div.divl2').css('height','527px');
	}	
}